This page gives you an overview how to produce bundles from XCode Projects for Libraries and how to consume them out of a XCode Application. This feature is available starting with version 1.1.0 of the Maven Xcode Plugin.

Exposing Bundle Resources

      |-- project-root
        |-- src
        |  |-- xcode                              The "xcode" folder contains the whole XCode project. Copy your project here.
        |     |-- <sources>, ...
        |     |-- MyNewProject.xcodeproj
        |     |-- MyNewProject.bundle             This folder contains the default bundle to be packaged for the library. Optional.
        |     |-- <AdditionalBundle1.bundle>      Additional bundles could be defined in parallel folders or in sub-folders
        |     |-- Resources
                 |-- <AdditionalBundle2.bundle>
        |     |-- MyNewProjectTests
        |        |-- <sources>, ...
        |      .....
        |
        |-- pom.xml                               The pom.xml has to be created on the same level as the "src" folder

Default Bundle

The bundle, located parallel to the MyNewProject.xcodeproj and called MyNewProject.bundle will be packaged automatically during the library build from the Maven Xcode Plugin. No configuration steps needed.

Additional Bundles

A Library project could expose arbitrary number of bundles. In this case they must be explicitly declared in your pom file.

Example snippet:

pom.xml
....
      <build>
          <plugins>
              <plugin>
                  <groupId>com.sap.prd.mobile.ios.mios</groupId>
                  <artifactId>xcode-maven-plugin</artifactId>
                  <extensions>true</extensions>
                  <configuration>
                    <bundles>
                      <bundle>AdditionalBundle1</bundle>
                      <bundle>Resources/AdditionalBundle2</bundle>
                    </bundles>
                  </configuration>
              </plugin>
               ....
          </plugins>
      </build>

Using Bundle Resources

Prerequisites

The dependent project is already specified in the dependencies section of the pom.xml.

Maven initialize

  • Open a Terminal and go to the folder containing the pom.xml.
  • Run the following command:
    mvn initialize
  • After this execution a "target" folder is created in your project folder, where all bundles additionally to all archives and headers from the dependent projects are downloaded.

Bundles in XCode

In the XCode IDE, just drag and drop the bundles you need into your project.